home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Applications / QuArK / plugins / map1addonsmenu.py < prev    next >
Text File  |  2004-01-05  |  5KB  |  71 lines

  1. """   QuArK  -  Quake Army Knife
  2.  
  3. Implementation of QuArK Map editor's "Addons" menu
  4. """
  5. #
  6. # Copyright (C) 1996-99 Armin Rigo
  7. # THIS FILE IS PROTECTED BY THE GNU GENERAL PUBLIC LICENCE
  8. # FOUND IN FILE "COPYING.TXT"
  9. #
  10.  
  11. #$Header: /cvsroot/quark/runtime/plugins/map1addonsmenu.py,v 1.1 2003/07/04 20:01:16 cdunde Exp $
  12.  
  13. Info = {
  14.    "plug-in":       "Addons Main Menu",
  15.    "desc":          "This adds the Addons Main menu item and its Categories to run and import 3rd party programs.",
  16.    "date":          "June 7 2003",
  17.    "author":        "cdunde, Decker and others",
  18.    "author e-mail": "cdunde1@attbi.com",
  19.    "quark":         "Version 6.4" }
  20.  
  21.  
  22. from quarkpy.maputils import *   # Need this
  23. import quarkpy.mapcommands   # Need this for sub-menu appending
  24.  
  25.  
  26. # ************************************************************
  27. # ************************************************************
  28.  
  29. # Deckers coding ******************************
  30.  
  31.  
  32. # Global variables, the sub-menuitems/popup-menus
  33.  
  34. ShapesMenu = qmenu.popup("&Shape programs", [], None, "|Shape programs:\n\nThese are programs that can make different shapes to use in your maps.\n\nOne that I recommend is 'MGS-object builder' and can be downloaded from the Yahoo Quark group site at\n\nhttp://groups.yahoo.com/group/quark/files/\n\nIf you find any programs that may help others, please let us know by making a posting to the Quark groups site at\n\nhttp://groups.yahoo.com/group/quark/", "intro.mapeditor.menu.html#addonsmenu")
  35.  
  36. TerrainMenu = qmenu.popup("&Terrain programs", [], None, "|Terrain programs:\n\nThis category is for your terrain programs for making landscape layouts in your maps.\n\nOne that I recommend is 'Terrain Generator' and can be downloaded from its own site at\n\nhttp://countermap.counter-strike.net/Nemesis/index.php?p=1\n\nIf you find any programs that may help others, please let us know by making a posting to the Quark groups site at\n\nhttp://groups.yahoo.com/group/quark/", "intro.mapeditor.menu.html#addonsmenu")
  37.  
  38. OtherMenu = qmenu.popup("&Other programs", [], None, "|Other programs:\n\nThis category is for all other types of programs that can export to a map file for your use in QuArk.\n\nIf you find any programs that may help others, please let us know by making a posting to the Quark groups site at\n\nhttp://groups.yahoo.com/group/quark/", "intro.mapeditor.menu.html#addonsmenu")
  39.  
  40. # The main Addons-menu (and shortcuts if any)
  41. AddonsMenu = [ShapesMenu, TerrainMenu, OtherMenu] # The Addons menu items
  42. AddonsMenuShortcuts = {}                     # The Addons menu shortcuts
  43.  
  44. def AddonsMenuCmds():       # AddonsMenuCmds used in quarkpy/mapmenus.py
  45.     return quarkpy.qmenu.popup("&Addons", AddonsMenu, hint="|Addons:\n\nThis Main menu category was added for 3rd party, outside programs that can be ran from within QuArK.\n\nEach item through out this menu has its own help dialog. Just high light the menu item and press F1 for further help and a link to the infobase for further details if an 'InfoBase' link button exist in the help window.\n\nHistory:\n\nThis was originally intended to be the MGS file menu:\n\n With the MGS addon program, you can create several different types of shape items to be used in you maps.\n\nYou can also give your personal input to change these shapes as well as their size.\n\nIn addition, you can create plugins for the MGS program, to enhance its abilities to create shapes and/or common standard shapes and sizes to make your own library.\n\nBut the Addons menu function has now gone well beyond that. It demonstrates how a Main menu category can be added with a plugin file. The file name is map1addonsmenu.py and it also demonstrates how even a Main menu button can have an F1 help popup window and link to the infobase pages. The only difference is that one of the buttons of the Main menu has to be activated (clicked on) to initiate this feature. One other feature of this menu category, is the sub-menu drop down buttons. All these functions can be studied by reviewing the map1addonsmenu file in the plugins folder, and the mapmenus.py file located in the quarkpy folder (to see how the 'Addons' Main menu category is done).", infobaselink="intro.mapeditor.menu.html#addonsmenu"), AddonsMenuShortcuts
  46.  
  47.  
  48. ### Use another .py file to add items to the menu categories ### 
  49.  
  50. def Func1Click(self):
  51.  
  52. #Put the function code here
  53.     pass
  54.     editor = mapeditor()
  55.     import map1loadanymap
  56.     plugins.map1loadanymap.LoadMapClick(self)
  57.  
  58. # Add a menu item to the Addons->OtherMenu category
  59.  
  60.  
  61. OtherMenu.items.append(qmenu.sep)
  62. OtherMenu.items.append(quarkpy.qmenu.item("Import any map file", Func1Click, "|Import any map file:\n\nThis item function allows you to load any map file into the existing editor to be added to the map you are working on.\n\nBecause it also may import entities, you may half to delete some of them like its info_player_start.\n\nThis function is created by the plugins/map1loadanymap.py file.|intro.mapeditor.menu.html#addonsmenu"))
  63.  
  64.  
  65. # ----------- REVISION HISTORY ------------
  66. #
  67. #$Log: map1addonsmenu.py,v $
  68. #Revision 1.1  2003/07/04 20:01:16  cdunde
  69. #To add new Addons main menu item and sub-menus
  70. #
  71.